#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int p;
ll sum;
int main()
{
	int n;
	cin >> n;
	p = n;
	while (p)
	{
		p--;
		sum++;
		if (sum % 3 == 0)
			p++;
	}
	cout << sum << endl;
}